<template>
	<view class="container">
		<view class="first">
			<view class="first-1">注销 {{phonenumber}} 的用户账户</view>
			<view class="first-2">请确保所有的交易已完结且无纠纷</view>
			<view class="first-3">
				<image src="https://images.linglinggong.net/Fs6Xmf5QNCIhSAKB3Sfj_WYpM6zx" mode="aspectFill"></image>
			</view>
			<view class="first-4">
				<image src="https://images.linglinggong.net/Fo8hLqQP178ZdY_Q0aj0W1eqgXM_" mode="widthFix"></image>
			</view>
			<view class="first-5">
				<view class="tips-img" v-if="isSelect2">
					<image src="https://images.linglinggong.net/FuM_thkibGYbqteWzdP8LdwIf_wd" mode="widthFix"></image>
				</view>
				<view class="first-5-top">
					<view class="first-5-top-left">
						<u-checkbox-group placement="row" @change="handleSelect">
							<u-checkbox size="30" activeColor="#FCC928" shape="circle"></u-checkbox>
						</u-checkbox-group>
						<!-- <checkbox style="border-radius: 50% !important;color: #FCC928" @click="handleSelect()"></checkbox> -->
					</view>
					<view class="first-5-top-right">
						<text>我已阅读并同意</text>
						<text @click="handleOpenArticle" style="color: #3287D2;padding-left: 5rpx;">《找零工平台账户注销须知》</text>
					</view>
				</view>
				<view class="first-5-bottom" @click="next">
					<image src="https://images.linglinggong.net/FoSRaZFE053-VGc_v1_01c3zG3pU" mode="aspectFill"></image>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				isSelect: false,
				isSelect2: false,
				phonenumber: ''
			}
		},
		onLoad() {
			this.getUserInfo()
		},
		onShareAppMessage() {
			if (uni.getStorageSync('userType') == 1) {
				return {
					title: "足不出户，免费招工",
					desc: "线上招募零工，工价透明，免费使用",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employer-share.jpg',
					success: res => {}
				}
			} else {
				return {
					title: "在家找日结兼职，工种齐全",
					desc: "免费使用，提前在家找日结兼职",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employee-share.jpg',
					success: res => {}
				}
			}
		},
		methods: {
			async getUserInfo() {
				let res = await this.$fetch(this.$api.get_current_user, {}, 'GET')
				if (res.code) return
				this.phonenumber = res.data.user.phonenumber
				this.phonenumber = this.phonenumber.replace(this.phonenumber.substring(3, 7), '****')
			},
			handleSelect() {
				this.isSelect = !this.isSelect
				if (this.isSelect) {
					this.isSelect2 = false
				}
			},
			next() {
				if (this.isSelect) {
					uni.navigateTo({
						url: '/pages/account-security/account-logout'
					})
				} else {
					this.isSelect2 = true
				}
			},
			handleOpenArticle() {
				uni.navigateTo({
					url: '/pages/user-agreement/service-agreement?id=24'
				})
			},
		}
	}
</script>
<style lang="less" scoped>
	.container {
		.first {
			.first-1 {
				padding-top: 20rpx;
				font-size: 32rpx;
				font-weight: 600;
				padding-left: 44rpx;
			}

			.first-2 {
				font-size: 24rpx;
				padding-left: 44rpx;
				padding-top: 20rpx;
				padding-bottom: 20rpx;
			}

			.first-3 {
				width: 100%;
				display: flex;
				justify-content: center;
				align-items: center;

				// border: 1px solid;
				image {
					width: 95%;
					height: 500rpx;
				}
			}

			.first-4 {
				display: flex;
				justify-content: center;
				align-items: center;
				padding-top: 20rpx;

				image {
					width: 420rpx;
					height: 100%;
				}
			}

			.first-5 {
				position: fixed;
				left: 0;
				bottom: 0;
				width: 100%;
				height: 220rpx;
				background: #fff;

				.tips-img {
					position: absolute;
					left: 10%;
					top: -26rpx;

					image {
						width: 166rpx;
						height: 100%;
					}
				}

				.first-5-top {
					padding-top: 30rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					width: 100%;
					height: 50rpx;

					// border: 1px solid;
					.first-5-top-left {
						padding-right: 10rpx;
					}

					.first-5-top-right {
						font-size: 26rpx;
					}
				}

				.first-5-bottom {
					padding-top: 10rpx;
					display: flex;
					justify-content: center;
					align-items: center;

					image {
						width: 82%;
						height: 90rpx;
					}
				}
			}
		}
	}
</style>